Skip to content

Bump Newtonsoft.Json to 13.0.1 #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 24, 2022
Merged

Bump Newtonsoft.Json to 13.0.1 #369

merged 4 commits into from
Nov 24, 2022

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Nov 23, 2022

Bump Newtonsoft.Json to 13.0.1

  • also bump Newtonsoft.Json.Bson to 1.0.2 in System.Net.Http.Formatting.NetStandard
  • incorporates changes from 23 Dependabot PRs; they are now obsolete
    • Dependabot also left @(Reference) items alone in project files 😦
    • fixed what Dependabot didn't do i.e. corrected paths and assembly identities in those items
Release notes

Sourced from Newtonsoft.Json's releases.

13.0.1

  • New feature - Add JsonSelectSettings with configuration for a regex timeout
  • Change - Remove portable assemblies from NuGet package
  • Change - JsonReader and JsonSerializer MaxDepth defaults to 64
  • Fix - Fixed throwing missing member error on ignored fields
  • Fix - Fixed various nullable annotations
  • Fix - Fixed annotations not being copied when tokens are cloned
  • Fix - Fixed naming strategy not being used when deserializing dictionary enum keys
  • Fix - Fixed serializing nullable struct dictionaries
  • Fix - Fixed JsonWriter.WriteToken to allow null with string token
  • Fix - Fixed missing error when deserializing JToken with a contract type mismatch
  • Fix - Fixed JTokenWriter when writing comment to an object

12.0.3

  • New feature - Added support for nullable reference types
  • New feature - Added KebabCaseNamingStrategy
  • Change - Package now uses embedded package icon
  • Fix - Fixed bug when merging JToken with itself
  • Fix - Fixed performance of calling ICustomTypeDescriptor.GetProperties
  • Fix - Fixed serializing Enumerable.Empty and empty arrays on .NET Core 3.0
  • Fix - Fixed deserializing some collection types with constructor
  • Fix - Fixed deserializing IImmutableSet to ImmutableHashSet instead of ImmutableSortedSet
  • Fix - Fixed deserializing IImmutableDictionary to ImmutableDictionary instead of ImmutableSortedDictionary
  • Fix - Fixed deserializing into constructors with more than 256 parameters
  • Fix - Fixed hang when deserializing JTokenReader with preceding comment
  • Fix - Fixed JSONPath scanning with nested indexer
  • Fix - Fixed deserializing incomplete JSON object to JObject
  • Fix - Fixed using StringEnumConverter with naming strategy and specified values

12.0.2

  • New feature - Added MissingMemberHandling to JsonObjectAttribute and JsonObjectContract
  • New feature - Added constructor to JTokenReader to specify initial path
  • New feature - Added JsonProperty.IsRequiredSpecified
  • New feature - Added JsonContract.InternalConverter
  • Change - Moved embedded debug symbols in NuGet package to a symbol package on NuGet.org
  • Fix - Fixed deserializing nullable struct collections
  • Fix - Fixed memory link when serializing enums to named values
  • Fix - Fixed error when setting JsonLoadSettings.DuplicatePropertyNameHandling to Replace

12.0.1

  • New feature - Added NuGet package signing
  • New feature - Added Authenticode assembly signing
  • New feature - Added SourceLink support
  • New feature - Added constructors to StringEnumConverter for setting AllowIntegerValue
  • New feature - Added JsonNameTable and JsonTextReader.PropertyNameTable
  • New feature - Added line information to JsonSerializationException
  • New feature - Added JObject.Property overload with a StringComparison
  • New feature - Added JsonMergeSettings.PropertyNameComparison
  • New feature - Added support for multiple Date constructors with JavaScriptDateTimeConverter
  • New feature - Added support for strict equals and strict not equals in JSON Path queries

... (truncated)

Commits

React to Newtonsoft.Json changes

  • react to BsonReader, BsonWriter deprecation
  • one of our DateTime tests now consistently hits 5 errors
  • s/True/true/ also consistent now in another test

Remove Newtonsoft.Json binding redirects

  • where possible, entirely remove app.config files
  • w/ consistent Newtonsoft.Json versions, these special cases are mostly not needed
    • auto-generation of .config file handles the special case just fine in
      System.Net.Http.Formatting.NetStandard.Test.csproj and System.Web.Http.SignalR.Test.csproj

- combine `RegexReplace` into `PrintTestRunSummary` task
  - remove unused `WarnOnNoMatch` parameter; inline other parameters
  - capture test summary in `msbuild` logs
    - avoid `System.Console` use in the task
  - fail task if any tests fail
- collect `xunit` task exit codes in case of catastrophic problems (not test failures)
  - fail build if `PrintTestRunSummary` doesn't but errors occurred

also:
- do not test assemblies in parallel; reduce port contention issues
- avoid `CallTarget` task

nits:
- clean some trailing whitespace in C# sources
  - mostly files I expect to update soon
- reduce `NuGet.exe restore` verbosity; no longer debugging that
- add console summary when using build.cmd
- reduce duplication in `RestorePackages` target
  - only restore NetCore projects when `$(BuildPortable)` is `true`
  - restore src NetStandard project transitively through NetStandard.Test project
- pass more properties w/ `Restore` target invocation
- also bump Newtonsoft.Json.Bson to 1.0.2 in System.Net.Http.Formatting.NetStandard
- incorporates changes from 23 Dependabot PRs; they are now obsolete
  - Dependabot also left `@(Reference)` items alone in project files 😦
  - fixed what Dependabot didn't do i.e. corrected paths and assembly identities in those items

<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/JamesNK/Newtonsoft.Json/releases">Newtonsoft.Json's releases</a>.</em></p>
<blockquote>
<h2>13.0.1</h2>
<ul>
<li>New feature - Add JsonSelectSettings with configuration for a regex timeout</li>
<li>Change - Remove portable assemblies from NuGet package</li>
<li>Change - JsonReader and JsonSerializer MaxDepth defaults to 64</li>
<li>Fix - Fixed throwing missing member error on ignored fields</li>
<li>Fix - Fixed various nullable annotations</li>
<li>Fix - Fixed annotations not being copied when tokens are cloned</li>
<li>Fix - Fixed naming strategy not being used when deserializing dictionary enum keys</li>
<li>Fix - Fixed serializing nullable struct dictionaries</li>
<li>Fix - Fixed JsonWriter.WriteToken to allow null with string token</li>
<li>Fix - Fixed missing error when deserializing JToken with a contract type mismatch</li>
<li>Fix - Fixed JTokenWriter when writing comment to an object</li>
</ul>
<h2>12.0.3</h2>
<ul>
<li>New feature - Added support for nullable reference types</li>
<li>New feature - Added KebabCaseNamingStrategy</li>
<li>Change - Package now uses embedded package icon</li>
<li>Fix - Fixed bug when merging JToken with itself</li>
<li>Fix - Fixed performance of calling ICustomTypeDescriptor.GetProperties</li>
<li>Fix - Fixed serializing Enumerable.Empty and empty arrays on .NET Core 3.0</li>
<li>Fix - Fixed deserializing some collection types with constructor</li>
<li>Fix - Fixed deserializing IImmutableSet to ImmutableHashSet instead of ImmutableSortedSet</li>
<li>Fix - Fixed deserializing IImmutableDictionary to ImmutableDictionary instead of ImmutableSortedDictionary</li>
<li>Fix - Fixed deserializing into constructors with more than 256 parameters</li>
<li>Fix - Fixed hang when deserializing JTokenReader with preceding comment</li>
<li>Fix - Fixed JSONPath scanning with nested indexer</li>
<li>Fix - Fixed deserializing incomplete JSON object to JObject</li>
<li>Fix - Fixed using StringEnumConverter with naming strategy and specified values</li>
</ul>
<h2>12.0.2</h2>
<ul>
<li>New feature - Added MissingMemberHandling to JsonObjectAttribute and JsonObjectContract</li>
<li>New feature - Added constructor to JTokenReader to specify initial path</li>
<li>New feature - Added JsonProperty.IsRequiredSpecified</li>
<li>New feature - Added JsonContract.InternalConverter</li>
<li>Change - Moved embedded debug symbols in NuGet package to a symbol package on NuGet.org</li>
<li>Fix - Fixed deserializing nullable struct collections</li>
<li>Fix - Fixed memory link when serializing enums to named values</li>
<li>Fix - Fixed error when setting JsonLoadSettings.DuplicatePropertyNameHandling to Replace</li>
</ul>
<h2>12.0.1</h2>
<ul>
<li>New feature - Added NuGet package signing</li>
<li>New feature - Added Authenticode assembly signing</li>
<li>New feature - Added SourceLink support</li>
<li>New feature - Added constructors to StringEnumConverter for setting AllowIntegerValue</li>
<li>New feature - Added JsonNameTable and JsonTextReader.PropertyNameTable</li>
<li>New feature - Added line information to JsonSerializationException</li>
<li>New feature - Added JObject.Property overload with a StringComparison</li>
<li>New feature - Added JsonMergeSettings.PropertyNameComparison</li>
<li>New feature - Added support for multiple Date constructors with JavaScriptDateTimeConverter</li>
<li>New feature - Added support for strict equals and strict not equals in JSON Path queries</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/ae9fe44e1323e91bcbd185ca1a14099fba7c021f"><code>ae9fe44</code></a> Remove compiler package and update sourcelink (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2498">#2498</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/8ef662189dd7fc890c8fcd832d3e283edb90ef31"><code>8ef6621</code></a> Remove prerelease for 13.0.1</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/11331f50fd1c09dc1f44fe17ef26aba7c460b42c"><code>11331f5</code></a> Update SDK to 5.0.200 (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2495">#2495</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/c7e8abc09de751785355e3f972150f8a72379b02"><code>c7e8abc</code></a> Update to 13.0.1-beta2</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/1745d7c14ec7e4244a5ca1c7ddf5d955cf7d1f43"><code>1745d7c</code></a> Fix JTokenWriter when writing comment to an object (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2493">#2493</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/583eb120152f8b6332df2fe3d4b9f4c947c944d0"><code>583eb12</code></a> Fix missing error when deserializing JToken with a contract type mismatch (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2">#2</a>...</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/b6dc05be5a0f4808f06ec430f3bb59b24d3fbc3e"><code>b6dc05b</code></a> Change MaxDepth default to 64 (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2473">#2473</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/15525f1c44e0d99ef8fdee73430853e22239181d"><code>15525f1</code></a> Fix JsonWriter.WriteToken to allow null with string token (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2472">#2472</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/926d2f0f42292cfcdf07cdadeb501b73fd5b1d52"><code>926d2f0</code></a> Enable embed untracked sources (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2471">#2471</a>)</li>
<li><a href="https://github.com/JamesNK/Newtonsoft.Json/commit/0a56633b6cd4fccc860a8486260ee67636f3fe90"><code>0a56633</code></a> Fixes <a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2372">#2372</a> - variable typos (<a href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2465">#2465</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/JamesNK/Newtonsoft.Json/compare/6.0.4...13.0.1">compare view</a></li>
</ul>
</details>
- react to `BsonReader`, `BsonWriter` deprecation
- one of our `DateTime` tests now consistently hits `5` errors
- `s/True/true/` also consistent now in another test
- where possible, entirely remove app.config files
- w/ consistent Newtonsoft.Json versions, these special cases are mostly not needed
  - auto-generation of .config file handles the special case just fine in
  System.Net.Http.Formatting.NetStandard.Test.csproj and System.Web.Http.SignalR.Test.csproj
@@ -340,9 +340,9 @@ public async Task FormatterThrowsOnReadWithInvalidContent()
stream.Seek(0L, SeekOrigin.Begin);

// Act & Assert
await Assert.ThrowsAsync<OverflowException>(
await Assert.ThrowsAsync<JsonReaderException>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Add following to final commit description

  • decimal overflow now throws a JsonReaderException

Base automatically changed from dougbu/Newtonsoft.Json.part2 to main November 24, 2022 01:07
@dougbu dougbu merged commit d2c6660 into main Nov 24, 2022
@dougbu dougbu deleted the dougbu/Newtonsoft.Json.part3 branch November 24, 2022 01:55
@dougbu dougbu added this to the 3.3.0 (5.3.0) milestone Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants